package com.example.demo;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author java1234_小锋
 * @site www.java1234.com
 * @company Java知识分享网
 * @create 2021-06-12 15:37
 */
@RestController
public class TestController {

    @GetMapping("/test")
    public String test(@RequestParam("id") Integer id, @RequestParam("name")String name){
        System.out.println("id="+id);
        System.out.println("name="+name);
        if(id>0){
            return "success "+name;
        }else{
            return "fail";
        }
    }

}